

package system





//getSystemInfoListCount 获取系统信息列表条数
const getSystemInfoListCount = `
select 
	count(1)
from sso_system_info t
where
	?t.name
	&t.enable`


	
//getSystemInfoList 查询系统信息列表数据
const getSystemInfoList = `
select
	t.id,
	t.name,
	t.version,
	t.index_url,
	t.login_timeout,
	t.login_url,
	t.wechat_status,
	t.enable,
	t.logo,
	t.theme,
	t.layout,
	t.bg_url,
	t.ident,
	1
from sso_system_info t
where
	?t.name
	&t.enable
order by 
	t.id desc
limit @ps offset @offset`

// insertSystemInfo 保存系统信息数据
const insertSystemInfo = `
insert into sso_system_info
(
	name,
	version,
	index_url,
	login_timeout,
	logo,
	theme,
	layout,
	bg_url,
	ident,
	login_url,
	wechat_status,
	enable
	)
values
(
	@name,
	@version,
	@index_url,
	@login_timeout,
	@logo,
	@theme,
	@layout,
	@bg_url,
	@ident,
	@login_url,
	@wechat_status,
	@enable
	)`

//updateSystemInfo 修改系统信息数据
const updateSystemInfo = `
update sso_system_info t set
	t.name = @name,
	t.version = @version,
	t.index_url = @index_url,
	t.login_timeout = @login_timeout,
	t.logo = @logo,
	t.theme = @theme,
	t.layout = @layout,
	t.bg_url = @bg_url,
	t.ident = @ident,
	t.login_url = @login_url,
	t.enable = @enable
where
	&id`

//getSystemInfo 查询单条系统信息数据
const getSystemInfo = `
select
	t.id,
	t.name,
	t.version,
	t.index_url,
	t.login_timeout,
	t.login_url,
	t.wechat_status,
	t.enable,
	t.logo,
	t.theme,
	t.layout,
	t.bg_url,
	t.ident
from sso_system_info t
where
	&id`


//deleteSystemInfo 删除单条系统信息数据
const deleteSystemInfo = `
delete from sso_system_info
where
	&id`